package com.dongjiantong.farmrecords.service;

import com.dongjiantong.common.web.sso.LoginInfo;
import com.dongjiantong.farmrecords.model.FarmRecordsFile;
import com.dongjiantong.farmrecords.model.FarmRecordsHarmlesses;
import com.dongjiantong.mybatis.BaseService;
import com.github.pagehelper.PageInfo;

import java.util.List;
import java.util.Map;

/**
 * @author Lee
 * @date 2018/1/9
 */

public interface FarmRecordsHarmlessesService extends BaseService<FarmRecordsHarmlesses> {
    /**
     * 根据单据前缀查找表中最大单据号
     * @param prefix
     * @return
     */
    String findMaxNumber(String prefix);

    /**
     * 新增非集中处理无害化单据id
     * @param farmrecordsHarmlesses
     * @return
     */
    Map<String,Object> createOne(LoginInfo loginInfo, FarmRecordsHarmlesses farmrecordsHarmlesses, Integer toStatus, Integer isFrom);

    /**
     * (政府端)
     * 根据养殖场ids,起止时间或者状态查询非集中无害化处理记录 (条件都可以为空,表示查询所有)
     * @param map
     * @param pageNum
     * @param pageSize
     * @return  Response<PageInfo<FarmRecordsHarmlesses>>
     */
    PageInfo<FarmRecordsHarmlesses> selectByMap(Integer pageNum, Integer pageSize, Map<String, Object> map);

    /**
     * 养殖端
     * 根据提交状态分页查询列表
     * @param farmId
     * @param status
     * @return
     */
    PageInfo<FarmRecordsHarmlesses> selectListByStatus(Integer pageNum, Integer pageSize, Integer status, Long farmId, Integer nonBull);

    /**
     * 根据id或者number 更新一条单据信息
     * @param farmRecordsHarmlesses 请求的对象
     * @return  boolean (更新成功返回true 反之返回false)
     */
    Integer updateByIdOrNumber(FarmRecordsHarmlesses farmRecordsHarmlesses, Integer toStatus);

    /**
     * 设置图片和视频
     * @param
     */
    FarmRecordsHarmlesses setPicOrVideoByObject(FarmRecordsHarmlesses farmRecordsHarmlesses, List<FarmRecordsFile> farmRecordsFileList);

    /**
     * 根据牛档案关联id 查询对应非集中处理无害化
     * @param cowRecordId
     * @return
     */
    FarmRecordsHarmlesses selectBullHarmlessesNoCenter(Long cowRecordId);

    /**
     * 根据牛档案单据ids 查询无害化记录
     * @param ids
     * @return
     */
    List<Map<String,Object>> selectHarmlessesNoCenterCount(List<Long> ids);

    /**
     * 创建牛档案无害化
     * @param loginInfo
     * @param farmRecordsHarmlesses
     * @param toStatus
     * @param i
     * @return
     */
    Map<String,Object> createCowOne(LoginInfo loginInfo, FarmRecordsHarmlesses farmRecordsHarmlesses, Integer toStatus, int i);

    List<Map<String,Object>> findAWeekSum(Map<String, Object> paramsMap);
}
